/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Map;

import Actor.TileObject;
import java.awt.Rectangle;
import java.awt.geom.Area;
import java.awt.geom.Rectangle2D;
import javax.vecmath.Point2d;

/**
 *
 * @author Eric-Standard
 */
public class MapWall extends TileObject {

    private Rectangle r = new Rectangle();
    private Area area;

    public MapWall() {
        super();
        r.x = (int) pos.x;
        r.y = (int) pos.y;
        initRect();
        area = new Area(r);
    }

    public MapWall(Point2d p) {
        super(p);
        r.x = (int) p.x;
        r.y = (int) p.y;
        initRect();
        area = new Area(r);
    }

    private void initRect() {
        r.height = Map.TILE_HEIGHT;
        r.width = Map.TILE_WIDTH;
    }

    @Override
    public void setPos(Point2d p) {
        super.setPos(pos);
        r.x = (int) p.x;
        r.y = (int) p.y;
        area = new Area(r);
    }

    @Override
    public Rectangle2D getBoundingRectangle() {
        return r;
    }

    @Override
    public Area getArea() {
        return area;
    }
}
